package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.UniversitySpecialtyDto;
import xyz.zhouzhaodong.crm.service.IUniversitySpecialtyService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 高校-专业表 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-22
 */
@RestController
@RequestMapping("/university-specialty")
public class UniversitySpecialtyController {
    
    @Resource
    IUniversitySpecialtyService universitySpecialtyService;

    /**
     * 新增高校专业信息
     * @param universitySpecialtyDto
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addUniversitySpecialty(UniversitySpecialtyDto universitySpecialtyDto){
        return universitySpecialtyService.addUniversitySpecialty(universitySpecialtyDto);
    }

    /**
     * 删除高校专业信息
     * @param universitySpecialtyDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteUniversitySpecialty(UniversitySpecialtyDto universitySpecialtyDto){
        return universitySpecialtyService.deleteUniversitySpecialty(universitySpecialtyDto);
    }

    /**
     * 修改高校专业信息
     * @param universitySpecialtyDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateUniversitySpecialty(UniversitySpecialtyDto universitySpecialtyDto){
        return universitySpecialtyService.updateUniversitySpecialty(universitySpecialtyDto);
    }

    /**
     * 查询高校专业信息
     * @param universitySpecialtyDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectUniversitySpecialty(UniversitySpecialtyDto universitySpecialtyDto){
        return universitySpecialtyService.selectUniversitySpecialty(universitySpecialtyDto);
    }
}
